home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.09 Sep 90 / TEDemo / TEDemo.r < prev    next >
Encoding:
Text File  |  1990-06-24  |  7.1 KB  |  340 lines  |  [TEXT/MPS ]

  1. /* 
  2.     ©1987-89 Apple Computer. All Rights Reserved.
  3. */
  4.  
  5. #ifndef __TYPES.R__
  6. #include "Types.r"
  7. #endif
  8.  
  9. #ifndef __SYSTYPES.R__
  10. #include "SysTypes.r"
  11. #endif
  12.  
  13. #ifndef __MacAppTypes__
  14. #include "MacAppTypes.r"
  15. #endif
  16.  
  17. #ifndef __ViewTypes__
  18. #include "ViewTypes.r"
  19. #endif
  20.  
  21.  
  22. #if qDebug
  23. include "Debug.rsrc";
  24. #endif
  25.  
  26. include "MacApp.rsrc";
  27. include "Printing.rsrc";
  28.  
  29. include "TEOther.rsrc";    /* DLOG & DITL 1001; ICON 256,257; ICN# 128,129 */
  30. include "TEDemo" 'CODE';
  31.  
  32. #define cHelp         1001
  33. #define cDrawBox    2001
  34.  
  35. #define cBlack     5001
  36. #define cBlue         5002
  37. #define cGreen     5003
  38. #define cRed         5004
  39. #define cWhite     5005
  40.  
  41. #define kSignature        'JLMT'
  42. #define kDocFileType        'JL01'
  43. #define getInfoString    "©1990 J.Langowski/MacTutor. Translated from MacApp® Pascal."
  44.  
  45. /* ------------------------------------------------------------------------------------*/
  46. resource 'WIND' (1001, purgeable) {
  47.     {50, 20, 250, 450},
  48.     zoomDocProc,
  49.     invisible,
  50.     goAway,
  51.     0x0,
  52.     "<<<>>>"
  53. };
  54.  
  55.  
  56. /* ------------------------------------------------------------------------------------*/
  57. resource 'DITL' (201, purgeable) {
  58.      {    /* array DITLarray: 3 elements */
  59.         /* [1] */
  60.         {130, 182, 150, 262},
  61.         Button {
  62.             enabled,
  63.             "OK"
  64.         };
  65.         /* [2] */
  66.         {10, 80, 110, 270},
  67.         StaticText {
  68.             disabled,
  69.             "Displays text and boxes"
  70.             "\n\nThis program was written "
  71.             "with MacApp® © 1985-1989 Apple Computer, Inc."
  72.         };
  73.         /* [3] */
  74.         {10, 20, 42, 52},
  75.         Icon {
  76.             disabled,
  77.             1
  78.         }
  79.     }
  80. };
  81.  
  82. resource 'ALRT' (201, purgeable) {
  83.     {90, 100, 250, 412},
  84.     201,
  85.     {
  86.         OK, visible, silent;
  87.         OK, visible, silent;
  88.         OK, visible, silent;
  89.         OK, visible, silent
  90.     }
  91. };
  92.  
  93.  
  94. /* ------------------------------------------------------------------------------------*/
  95. resource 'cmnu' (1) {
  96.     1,
  97.     textMenuProc,
  98.     0x7FFFFFFB,
  99.     enabled,
  100.     apple,
  101.      {
  102.         "About TEDemo…", noIcon, noKey, noMark, plain, cAboutApp;
  103.         "Help…", noIcon, "H", noMark, plain, cHelp;
  104.         "-", noIcon, noKey, noMark, plain, nocommand
  105.     }
  106. };
  107.  
  108. resource 'cmnu' (2) {
  109.     2,
  110.     textMenuProc,
  111.     allEnabled,
  112.     enabled,
  113.     "File",
  114.      {
  115.         "New", noIcon, "N", noMark, plain, 10;
  116.         "Open…", noIcon, "O", noMark, plain, 20;
  117.         "-", noIcon, noKey, noMark, plain, nocommand;
  118.         "Close", noIcon, noKey, noMark, plain, 31;
  119.         "Save", noIcon, "S", noMark, plain, 30;
  120.         "Save As…", noIcon, noKey, noMark, plain, 32;
  121.         "Save a Copy In…", noIcon, noKey, noMark, plain, 33;
  122.         "-", noIcon, noKey, noMark, plain, nocommand;
  123.         "Page Setup…", noIcon, noKey, noMark, plain, 176;
  124.         "Print One", noIcon, "P", noMark, plain, 177;
  125.         "Print…", noIcon, noKey, noMark, plain, 178;
  126.         "-", noIcon, noKey, noMark, plain, nocommand;
  127.         "Quit", noIcon, "Q", noMark, plain, 36
  128.     }
  129. };
  130.  
  131. resource 'cmnu' (3) {
  132.     3,
  133.     textMenuProc,
  134.     allEnabled,
  135.     enabled,
  136.     "Edit",
  137.      {
  138.         "Undo", noIcon, "Z", noMark, plain, 101;
  139.         "-", noIcon, noKey, noMark, plain, nocommand;
  140.         "Cut", noIcon, "X", noMark, plain, 103;
  141.         "Copy", noIcon, "C", noMark, plain, 104;
  142.         "Paste", noIcon, "V", noMark, plain, 105;
  143.         "Clear", noIcon, noKey, noMark, plain, 106;
  144.         "-", noIcon, noKey, noMark, plain, nocommand;
  145.         "Show Clipboard", noIcon, noKey, noMark, plain, 35
  146.     }
  147. };
  148.  
  149. resource 'cmnu' (4) {
  150.     4,
  151.     textMenuProc,
  152.     allEnabled,
  153.     enabled,
  154.     "TextColor",
  155.      {
  156.         "Black", noIcon, noKey, noMark, plain, cBlack;
  157.         "Blue", noIcon, "B", noMark, plain, cBlue;
  158.         "Green", noIcon, "G", noMark, plain, cGreen;
  159.         "Red", noIcon, "R", noMark, plain, cRed;
  160.         "White", noIcon, noKey, noMark, outline, cWhite
  161.     }
  162. };
  163.  
  164. resource 'cmnu' (128) {
  165.     128,
  166.     textMenuProc,
  167.     allEnabled,
  168.     enabled,
  169.     "Buzzwords",    /* these words appear after Undo in the Edit menu */
  170.      {
  171.         "Page Setup Change", noIcon, noKey, noMark, plain, cChangePrinterStyle;
  172.         "Typing", noIcon, noKey, noMark, plain, cTyping;
  173.         "Drawing",  noIcon, noKey, noMark, plain, cDrawBox
  174.     }
  175. };
  176.  
  177. resource 'MBAR' (128) {
  178.     {1; 2; 3; 4}
  179. };
  180.  
  181.  
  182. resource 'mctb' (128) {
  183.     {
  184.     /* Blue */
  185.     4, 2,
  186.         {
  187.         0x0000, 0x0000, 0xFFFF;            /* Mark color */
  188.         0x0000, 0x0000, 0xFFFF;            /* Name color */
  189.         0x0000, 0x0000, 0xFFFF;            /* Command Key color */
  190.         0xFFFF, 0xFFFF, 0xFFFF            /* Background color */
  191.         };
  192.     /* Green */
  193.     4, 3,
  194.         {
  195.         0x0000, 0xDB00, 0x0000;            /* Mark color */
  196.         0x0000, 0xDB00, 0x0000;            /* Name color */
  197.         0x0000, 0xDB00, 0x0000;            /* Command Key color */
  198.         0xFFFF, 0xFFFF, 0xFFFF            /* Background color */
  199.         };
  200.     /* Red */
  201.     4, 4,
  202.         {
  203.         0xDB00, 0x0000, 0x0000;            /* Mark color */
  204.         0xDB00, 0x0000, 0x0000;            /* Name color */
  205.         0xDB00, 0x0000, 0x0000;            /* Command Key color */
  206.         0xFFFF, 0xFFFF, 0xFFFF            /* Background color */
  207.         }
  208.     }
  209. };
  210.  
  211.  
  212. /* --------------------------- memory usage ----------------------------------------*/
  213. resource 'SIZE' (-1) {
  214.     saveScreen,
  215.     acceptSuspendResumeEvents,
  216.     enableOptionSwitch,
  217.     canBackground,
  218.     MultiFinderAware,
  219.     backgroundAndForeground,
  220.     dontGetFrontClicks,
  221.     ignoreChildDiedEvents,
  222.     is32BitCompatible,
  223.     reserved,
  224.     reserved,
  225.     reserved,
  226.     reserved,
  227.     reserved,
  228.     reserved,
  229.     reserved,
  230. #if qDebug
  231.     640 * 1024,
  232.     512 * 1024
  233. #else
  234.     240 * 1024,
  235.     220 * 1024
  236. #endif
  237. };
  238.  
  239.  
  240. resource 'seg!' (256, purgeable) {
  241.     {
  242.         "GClose";
  243.         "GDoCommand";
  244.         "GNonRes";
  245.         "GFile";
  246.         "GOpen";
  247.         "GSelCommand";
  248.     }
  249. };
  250.  
  251. resource 'mem!' (256, purgeable) {
  252.     30 * 1024,        /* Add to temporary reserve */
  253.     0,                    /* Add to permanent reserve */
  254.     0                    /* Add to stack space */
  255. };
  256.  
  257.  
  258. /* -------------------------- Bundle resources -------------------------------------*/
  259. type kSignature as 'STR ';
  260.  
  261. resource kSignature (0) {
  262.     getInfoString;
  263. };
  264.  
  265. resource 'FREF' (128) {
  266.     'APPL', 0, "TEDemo"    /* Show application file with ICN# with local ID 0 */
  267. };
  268.  
  269. resource 'FREF' (129) {
  270.     kDocFileType, 1, "TEDemo"    /* Show document files with ICN# with local ID 1 */
  271. };
  272.  
  273. resource 'BNDL' (128) {
  274.     kSignature,        /* Application signature (creator) */
  275.     0,                /* Resource ID of version data */
  276.     {
  277.         'ICN#',    /* This is how to map local ICN# ids into resource IDs */
  278.         {
  279.             0, 128;    /* Local ICN# 0 is in resource 128 */
  280.             1, 129    /* Local ICN# 1 is in resource 129 */
  281.         };
  282.         'FREF',    /* This is how to map local FREF ids into resource IDs */
  283.         {
  284.             0, 128;    /* Local FREF 0 (arbitrary) is in resource 128 */
  285.             1, 129    /* Local FREF 1 (also arbitrary) is in resource 129 */
  286.         }
  287.     }
  288. };
  289.  
  290. /*--------------------------------------------------------------------------------
  291.  The overall package version
  292. --------------------------------------------------------------------------------*/
  293. RESOURCE 'vers' (2,
  294. #if qNames
  295. "Package Version",
  296. #endif
  297.     purgeable) {
  298.     0x02,
  299.     0x00,
  300.     beta,
  301.     0x06,
  302.     verUs,
  303.     "2.0ß9",
  304.     "MacApp® 2.0ß9, ©Apple Computer, Inc. 1989"
  305. };
  306.  
  307.  
  308. /*--------------------------------------------------------------------------------
  309.  The revision of this particular file
  310. --------------------------------------------------------------------------------*/
  311. RESOURCE 'vers' (1,
  312. #if qNames
  313. "File Version",
  314. #endif
  315.     purgeable) {
  316.     0x01,
  317.     0x00,
  318.     beta,
  319.     0x05,
  320.     verUs,
  321.     "TEDemo",
  322.     "v 0.0, ©JL/MacTutor 1990"
  323. };
  324.  
  325. /* =============================== debug window ================================= */
  326. resource 'dbug' (kDebugParamsID,
  327. #if qNames
  328. "Debug",
  329. #endif
  330.     purgeable) {
  331.         {350, 4, 474, 636},        /* Bounding rect for debug window */
  332.         1,                             /* Debug window font rsrc ID (normal = monaco) */
  333.         9,                                 /* Debug window font size (normal = 9) */
  334.         100,                            /* Number of lines */
  335.         100,                            /* Width of lines in characters */
  336.         true,                            /* open initially */
  337.         "Jörg's Debug Window"    /* Window title */
  338. };
  339.  
  340.